package de.se.ludoapp.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import de.se.ludoapp.LudoApplication;
import de.se.ludoapp.R;

/**
 * main menu, to choose what you want to do, for example "play", "visit game",
 * "show highscore".
 * 
 * @author Marlen Rotert
 * 
 */
public class Select_menuActivity extends Activity {

	private LudoApplication ludoApp;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// Initialise Stub LudoServer
		ludoApp = (LudoApplication) this.getApplication();

		// View
		setContentView(R.layout.select_menu);

		// Play Button
		Button buttonPlay = (Button) findViewById(R.id.buttonPlay);
		buttonPlay.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intentPlayerTable = new Intent(Select_menuActivity.this,
						PlayerTableActivity.class);
				startActivity(intentPlayerTable);
			}

		});

		// Show Game Tables Button
		Button buttonShowTables = (Button) findViewById(R.id.buttonShowTables);
		buttonShowTables.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				Intent intentVisitorTable = new Intent(
						Select_menuActivity.this, VisitorTableActivity.class);
				startActivity(intentVisitorTable);
				// TODO
			}

		});

		// Show Highscore Button
		Button buttonShowHighscore = (Button) findViewById(R.id.buttonShowHighscore);
		buttonShowHighscore.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				Intent intentHighscore = new Intent(Select_menuActivity.this,
						HighscoreActivity.class);
				startActivity(intentHighscore);
			}

		});

		// Back to Login Button
		Button buttonLogout = (Button) findViewById(R.id.buttonBackToLogin);
		buttonLogout.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intentHighscore = new Intent(Select_menuActivity.this,
						LoginRememberActivity.class);
				startActivity(intentHighscore);
			}

		});

	}

}
